package com.ngc.mall.core.enumeration;

import java.util.stream.Stream;

/**
 *
 * 日期类型
 * @author: chenxiaolin
 * @date 2023/10/21 14:52
**/
public enum DateType {
    DAY(1,"天"),
    WEEK(2,"周"),
    MONTH(3,"月"),
    QUARTER(4,"季"),
    YEAR(5,"年");

    private Integer value;

    DateType(Integer value,String description){
        this.value=value;
    };

    public Integer getValue() {
        return value;
    }

    public static DateType toType(int value){
        return Stream.of(DateType.values()).filter(c->c.value==value).findAny().orElse(null);
    }
}
